package reflect;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class ReflectDemo1 {
    public static void main(String[] args) throws ClassNotFoundException {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个类名");
        String className=sc.nextLine();
        Class c=Class.forName(className);








        /**
        //获取类对象
        Class cls=String.class;
        String name=cls.getName();
        System.out.println(name);
        name= cls.getSimpleName();
        System.out.println(name);

        //获取类的包名
        Package p=cls.getPackage();
        System.out.println(p);

        //获取类中所有方法名
        Method[] methods=cls.getMethods();
        for (Method m:methods) {
            System.out.println(m.getName());
        }
        */

    }
}
